export default function(sequelize, DataTypes) {
  return sequelize.define('msg_03', {
    _session_id: {
      type: DataTypes.STRING(200),
      allowNull: false,
      primaryKey: true,
      comment: "会话id"
    },
    _sender: {
      type: DataTypes.STRING(15),
      allowNull: false,
      comment: "发送者账号"
    },
    _timestamp: {
      type: DataTypes.STRING(15),
      allowNull: false,
      comment: "发送消息的时间"
    },
    _message: {
      type: DataTypes.STRING(5000),
      allowNull: false,
      comment: "发送的加密消息"
    },
    _status: {
      type: DataTypes.INTEGER.UNSIGNED,
      allowNull: false,
      defaultValue: 0,
      comment: "消息的状态 0正常 1撤回"
    },
    _update_time: {
      type: DataTypes.STRING(15),
      allowNull: false,
      comment: "消息最后更新的时间 比如撤回"
    }
  }, {
    sequelize,
    tableName: 'msg_03',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "_session_id" },
          { name: "_sender" },
          { name: "_timestamp" },
        ]
      },
    ]
  });
};
